/*
 *接口编写处...
*如果接口需要做Action的权限验证，请在Action上使用属性
*如: [ApiActionPermission("MES_ProductBind",Enums.ActionPermissionOptions.Search)]
 */
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using VolPro.Core.ManageUser;
using VolPro.Core.Utilities;
using VolPro.Entity.DomainModels;
using VolPro.MES.IServices;

namespace VolPro.MES.Controllers
{
    public partial class MES_ProductBindController
    {
        private readonly IMES_ProductBindService _service;//访问业务代码
        private readonly IHttpContextAccessor _httpContextAccessor;

        [ActivatorUtilitiesConstructor]
        public MES_ProductBindController(
            IMES_ProductBindService service,
            IHttpContextAccessor httpContextAccessor
        )
        : base(service)
        {
            _service = service;
            _httpContextAccessor = httpContextAccessor;
        }
        /// <summary>
        /// 上传装机信息
        /// </summary>
        /// <returns></returns>
        //[HttpPost, Route("上传装机信息"), AllowAnonymous]
        [HttpPost, Route("MES_SaveAssembly"), AllowAnonymous]
        public async Task<IActionResult> MES_SaveAssembly([FromBody] List<dynamic> dynamics)
        {
            return JsonNormal(await Service.MES_SaveAssembly(dynamics));
        }
    }
}
